3.2.58 \(\int \frac {f+g x+h x^2}{(d+e x) (a+b x+c x^2)^2} \, dx\) [158]

Optimal. Leaf size=407 \[ \frac {b^2 e f-b (c d f+a e g+a d h)-2 a (c e f-c d g-a e h)-\left (2 c^2 d f+b (b d-a e) h-c (b e f+b d g-2 a e g+2 a d h)\right ) x}{\left (b^2-4 a c\right ) \left (c d^2-b d e+a e^2\right ) \left (a+b x+c x^2\right )}+\frac {\left (4 c^3 d^3 f+b e \left (4 a b d e h-2 a^2 e^2 h+b^2 \left (e^2 f-d e g-d^2 h\right )\right )-2 c^2 d \left (b d (3 e f+d g)-2 a \left (3 e^2 f-d e g+d^2 h\right )\right )+2 c e \left (2 b^2 d^2 g+2 a^2 e (e g-d h)-a b \left (3 e^2 f+d e g+d^2 h\right )\right )\right ) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{\left (b^2-4 a c\right )^{3/2} \left (c d^2-b d e+a e^2\right )^2}+\frac {e \left (e^2 f-d e g+d^2 h\right ) \log (d+e x)}{\left (c d^2-b d e+a e^2\right )^2}-\frac {e \left (e^2 f-d e g+d^2 h\right ) \log \left (a+b x+c x^2\right )}{2 \left (c d^2-b d e+a e^2\right )^2} \]

[Out]

(b^2*e*f-b*(a*d*h+a*e*g+c*d*f)-2*a*(-a*e*h-c*d*g+c*e*f)-(2*c^2*d*f+b*(-a*e+b*d)*h-c*(2*a*d*h-2*a*e*g+b*d*g+b*e
*f))*x)/(-4*a*c+b^2)/(a*e^2-b*d*e+c*d^2)/(c*x^2+b*x+a)+(4*c^3*d^3*f+b*e*(4*a*b*d*e*h-2*a^2*e^2*h+b^2*(-d^2*h-d
*e*g+e^2*f))-2*c^2*d*(b*d*(d*g+3*e*f)-2*a*(d^2*h-d*e*g+3*e^2*f))+2*c*e*(2*b^2*d^2*g+2*a^2*e*(-d*h+e*g)-a*b*(d^
2*h+d*e*g+3*e^2*f)))*arctanh((2*c*x+b)/(-4*a*c+b^2)^(1/2))/(-4*a*c+b^2)^(3/2)/(a*e^2-b*d*e+c*d^2)^2+e*(d^2*h-d
*e*g+e^2*f)*ln(e*x+d)/(a*e^2-b*d*e+c*d^2)^2-1/2*e*(d^2*h-d*e*g+e^2*f)*ln(c*x^2+b*x+a)/(a*e^2-b*d*e+c*d^2)^2

________________________________________________________________________________________

Rubi [A]
time = 0.67, antiderivative size = 407, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {1660, 814, 648, 632, 212, 642} \begin {gather*} \frac {\tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right ) \left (2 c e \left (2 a^2 e (e g-d h)-a b \left (d^2 h+d e g+3 e^2 f\right )+2 b^2 d^2 g\right )+b e \left (-2 a^2 e^2 h+4 a b d e h+b^2 \left (d^2 (-h)-d e g+e^2 f\right )\right )-2 c^2 d \left (b d (d g+3 e f)-2 a \left (d^2 h-d e g+3 e^2 f\right )\right )+4 c^3 d^3 f\right )}{\left (b^2-4 a c\right )^{3/2} \left (a e^2-b d e+c d^2\right )^2}+\frac {-x \left (-c (2 a d h-2 a e g+b d g+b e f)+b h (b d-a e)+2 c^2 d f\right )-b (a d h+a e g+c d f)-2 a (-a e h-c d g+c e f)+b^2 e f}{\left (b^2-4 a c\right ) \left (a+b x+c x^2\right ) \left (a e^2-b d e+c d^2\right )}-\frac {e \log \left (a+b x+c x^2\right ) \left (d^2 h-d e g+e^2 f\right )}{2 \left (a e^2-b d e+c d^2\right )^2}+\frac {e \log (d+e x) \left (d^2 h-d e g+e^2 f\right )}{\left (a e^2-b d e+c d^2\right )^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(f + g*x + h*x^2)/((d + e*x)*(a + b*x + c*x^2)^2),x]

[Out]

(b^2*e*f - b*(c*d*f + a*e*g + a*d*h) - 2*a*(c*e*f - c*d*g - a*e*h) - (2*c^2*d*f + b*(b*d - a*e)*h - c*(b*e*f +
 b*d*g - 2*a*e*g + 2*a*d*h))*x)/((b^2 - 4*a*c)*(c*d^2 - b*d*e + a*e^2)*(a + b*x + c*x^2)) + ((4*c^3*d^3*f + b*
e*(4*a*b*d*e*h - 2*a^2*e^2*h + b^2*(e^2*f - d*e*g - d^2*h)) - 2*c^2*d*(b*d*(3*e*f + d*g) - 2*a*(3*e^2*f - d*e*
g + d^2*h)) + 2*c*e*(2*b^2*d^2*g + 2*a^2*e*(e*g - d*h) - a*b*(3*e^2*f + d*e*g + d^2*h)))*ArcTanh[(b + 2*c*x)/S
qrt[b^2 - 4*a*c]])/((b^2 - 4*a*c)^(3/2)*(c*d^2 - b*d*e + a*e^2)^2) + (e*(e^2*f - d*e*g + d^2*h)*Log[d + e*x])/
(c*d^2 - b*d*e + a*e^2)^2 - (e*(e^2*f - d*e*g + d^2*h)*Log[a + b*x + c*x^2])/(2*(c*d^2 - b*d*e + a*e^2)^2)

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 632

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 642

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[d*(Log[RemoveContent[a + b*x +
c*x^2, x]]/b), x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rule 648

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
 b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] &
& NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] &&  !NiceSqrtQ[b^2 - 4*a*c]

Rule 814

Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_)))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Int[Exp
andIntegrand[(d + e*x)^m*((f + g*x)/(a + b*x + c*x^2)), x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && NeQ[b^2 -
 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && IntegerQ[m]

Rule 1660

Int[(Pq_)*((d_.) + (e_.)*(x_))^(m_.)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{Q = Polynomi
alQuotient[(d + e*x)^m*Pq, a + b*x + c*x^2, x], f = Coeff[PolynomialRemainder[(d + e*x)^m*Pq, a + b*x + c*x^2,
 x], x, 0], g = Coeff[PolynomialRemainder[(d + e*x)^m*Pq, a + b*x + c*x^2, x], x, 1]}, Simp[(b*f - 2*a*g + (2*
c*f - b*g)*x)*((a + b*x + c*x^2)^(p + 1)/((p + 1)*(b^2 - 4*a*c))), x] + Dist[1/((p + 1)*(b^2 - 4*a*c)), Int[(d
 + e*x)^m*(a + b*x + c*x^2)^(p + 1)*ExpandToSum[((p + 1)*(b^2 - 4*a*c)*Q)/(d + e*x)^m - ((2*p + 3)*(2*c*f - b*
g))/(d + e*x)^m, x], x], x]] /; FreeQ[{a, b, c, d, e}, x] && PolyQ[Pq, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2
- b*d*e + a*e^2, 0] && LtQ[p, -1] && ILtQ[m, 0]

Rubi steps

\begin {align*} \int \frac {f+g x+h x^2}{(d+e x) \left (a+b x+c x^2\right )^2} \, dx &=\frac {b^2 e f-b (c d f+a e g+a d h)-2 a (c e f-c d g-a e h)-\left (2 c^2 d f+b (b d-a e) h-c (b e f+b d g-2 a e g+2 a d h)\right ) x}{\left (b^2-4 a c\right ) \left (c d^2-b d e+a e^2\right ) \left (a+b x+c x^2\right )}+\frac {\int \frac {\frac {2 c^2 d^2 f-b c d (e f+d g)-b e (b e f-b d g+a d h)+2 a c \left (2 e^2 f-d e g+d^2 h\right )}{c d^2-b d e+a e^2}+\frac {e \left (2 c^2 d f+b (b d-a e) h-c (b e f+b d g-2 a e g+2 a d h)\right ) x}{c d^2-b d e+a e^2}}{(d+e x) \left (a+b x+c x^2\right )} \, dx}{-b^2+4 a c}\\ &=\frac {b^2 e f-b (c d f+a e g+a d h)-2 a (c e f-c d g-a e h)-\left (2 c^2 d f+b (b d-a e) h-c (b e f+b d g-2 a e g+2 a d h)\right ) x}{\left (b^2-4 a c\right ) \left (c d^2-b d e+a e^2\right ) \left (a+b x+c x^2\right )}+\frac {\int \left (-\frac {\left (b^2-4 a c\right ) e^2 \left (e^2 f-d e g+d^2 h\right )}{\left (c d^2-b d e+a e^2\right )^2 (d+e x)}+\frac {2 c^3 d^3 f+b e^2 \left (b^2 (e f-d g)+2 a b d h-a^2 e h\right )-c^2 d \left (b d (3 e f+d g)-2 a \left (3 e^2 f-d e g+d^2 h\right )\right )+c e \left (2 b^2 d^2 g+2 a^2 e (e g-d h)-a b \left (5 e^2 f-d e g+3 d^2 h\right )\right )+c \left (b^2-4 a c\right ) e \left (e^2 f-d e g+d^2 h\right ) x}{\left (c d^2-b d e+a e^2\right )^2 \left (a+b x+c x^2\right )}\right ) \, dx}{-b^2+4 a c}\\ &=\frac {b^2 e f-b (c d f+a e g+a d h)-2 a (c e f-c d g-a e h)-\left (2 c^2 d f+b (b d-a e) h-c (b e f+b d g-2 a e g+2 a d h)\right ) x}{\left (b^2-4 a c\right ) \left (c d^2-b d e+a e^2\right ) \left (a+b x+c x^2\right )}+\frac {e \left (e^2 f-d e g+d^2 h\right ) \log (d+e x)}{\left (c d^2-b d e+a e^2\right )^2}-\frac {\int \frac {2 c^3 d^3 f+b e^2 \left (b^2 (e f-d g)+2 a b d h-a^2 e h\right )-c^2 d \left (b d (3 e f+d g)-2 a \left (3 e^2 f-d e g+d^2 h\right )\right )+c e \left (2 b^2 d^2 g+2 a^2 e (e g-d h)-a b \left (5 e^2 f-d e g+3 d^2 h\right )\right )+c \left (b^2-4 a c\right ) e \left (e^2 f-d e g+d^2 h\right ) x}{a+b x+c x^2} \, dx}{\left (b^2-4 a c\right ) \left (c d^2-b d e+a e^2\right )^2}\\ &=\frac {b^2 e f-b (c d f+a e g+a d h)-2 a (c e f-c d g-a e h)-\left (2 c^2 d f+b (b d-a e) h-c (b e f+b d g-2 a e g+2 a d h)\right ) x}{\left (b^2-4 a c\right ) \left (c d^2-b d e+a e^2\right ) \left (a+b x+c x^2\right )}+\frac {e \left (e^2 f-d e g+d^2 h\right ) \log (d+e x)}{\left (c d^2-b d e+a e^2\right )^2}-\frac {\left (e \left (e^2 f-d e g+d^2 h\right )\right ) \int \frac {b+2 c x}{a+b x+c x^2} \, dx}{2 \left (c d^2-b d e+a e^2\right )^2}-\frac {\left (4 c^3 d^3 f+b e \left (4 a b d e h-2 a^2 e^2 h+b^2 \left (e^2 f-d e g-d^2 h\right )\right )-2 c^2 d \left (b d (3 e f+d g)-2 a \left (3 e^2 f-d e g+d^2 h\right )\right )+2 c e \left (2 b^2 d^2 g+2 a^2 e (e g-d h)-a b \left (3 e^2 f+d e g+d^2 h\right )\right )\right ) \int \frac {1}{a+b x+c x^2} \, dx}{2 \left (b^2-4 a c\right ) \left (c d^2-b d e+a e^2\right )^2}\\ &=\frac {b^2 e f-b (c d f+a e g+a d h)-2 a (c e f-c d g-a e h)-\left (2 c^2 d f+b (b d-a e) h-c (b e f+b d g-2 a e g+2 a d h)\right ) x}{\left (b^2-4 a c\right ) \left (c d^2-b d e+a e^2\right ) \left (a+b x+c x^2\right )}+\frac {e \left (e^2 f-d e g+d^2 h\right ) \log (d+e x)}{\left (c d^2-b d e+a e^2\right )^2}-\frac {e \left (e^2 f-d e g+d^2 h\right ) \log \left (a+b x+c x^2\right )}{2 \left (c d^2-b d e+a e^2\right )^2}+\frac {\left (4 c^3 d^3 f+b e \left (4 a b d e h-2 a^2 e^2 h+b^2 \left (e^2 f-d e g-d^2 h\right )\right )-2 c^2 d \left (b d (3 e f+d g)-2 a \left (3 e^2 f-d e g+d^2 h\right )\right )+2 c e \left (2 b^2 d^2 g+2 a^2 e (e g-d h)-a b \left (3 e^2 f+d e g+d^2 h\right )\right )\right ) \text {Subst}\left (\int \frac {1}{b^2-4 a c-x^2} \, dx,x,b+2 c x\right )}{\left (b^2-4 a c\right ) \left (c d^2-b d e+a e^2\right )^2}\\ &=\frac {b^2 e f-b (c d f+a e g+a d h)-2 a (c e f-c d g-a e h)-\left (2 c^2 d f+b (b d-a e) h-c (b e f+b d g-2 a e g+2 a d h)\right ) x}{\left (b^2-4 a c\right ) \left (c d^2-b d e+a e^2\right ) \left (a+b x+c x^2\right )}+\frac {\left (4 c^3 d^3 f+b e \left (4 a b d e h-2 a^2 e^2 h+b^2 \left (e^2 f-d e g-d^2 h\right )\right )-2 c^2 d \left (b d (3 e f+d g)-2 a \left (3 e^2 f-d e g+d^2 h\right )\right )+2 c e \left (2 b^2 d^2 g+2 a^2 e (e g-d h)-a b \left (3 e^2 f+d e g+d^2 h\right )\right )\right ) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{\left (b^2-4 a c\right )^{3/2} \left (c d^2-b d e+a e^2\right )^2}+\frac {e \left (e^2 f-d e g+d^2 h\right ) \log (d+e x)}{\left (c d^2-b d e+a e^2\right )^2}-\frac {e \left (e^2 f-d e g+d^2 h\right ) \log \left (a+b x+c x^2\right )}{2 \left (c d^2-b d e+a e^2\right )^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.55, size = 405, normalized size = 1.00 \begin {gather*} \frac {-2 a^2 e h+2 c^2 d f x+b^2 (-e f+d h x)+b c (-e f x+d (f-g x))+a b (d h+e (g-h x))+2 a c (e (f+g x)-d (g+h x))}{\left (b^2-4 a c\right ) \left (-c d^2+e (b d-a e)\right ) (a+x (b+c x))}-\frac {\left (-4 c^3 d^3 f+2 c^2 d \left (b d (3 e f+d g)-2 a \left (3 e^2 f-d e g+d^2 h\right )\right )+b e \left (-4 a b d e h+2 a^2 e^2 h+b^2 \left (-e^2 f+d e g+d^2 h\right )\right )+2 c e \left (-2 b^2 d^2 g+2 a^2 e (-e g+d h)+a b \left (3 e^2 f+d e g+d^2 h\right )\right )\right ) \tan ^{-1}\left (\frac {b+2 c x}{\sqrt {-b^2+4 a c}}\right )}{\left (-b^2+4 a c\right )^{3/2} \left (c d^2+e (-b d+a e)\right )^2}+\frac {e \left (e^2 f-d e g+d^2 h\right ) \log (d+e x)}{\left (c d^2+e (-b d+a e)\right )^2}-\frac {e \left (e^2 f-d e g+d^2 h\right ) \log (a+x (b+c x))}{2 \left (c d^2+e (-b d+a e)\right )^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(f + g*x + h*x^2)/((d + e*x)*(a + b*x + c*x^2)^2),x]

[Out]

(-2*a^2*e*h + 2*c^2*d*f*x + b^2*(-(e*f) + d*h*x) + b*c*(-(e*f*x) + d*(f - g*x)) + a*b*(d*h + e*(g - h*x)) + 2*
a*c*(e*(f + g*x) - d*(g + h*x)))/((b^2 - 4*a*c)*(-(c*d^2) + e*(b*d - a*e))*(a + x*(b + c*x))) - ((-4*c^3*d^3*f
 + 2*c^2*d*(b*d*(3*e*f + d*g) - 2*a*(3*e^2*f - d*e*g + d^2*h)) + b*e*(-4*a*b*d*e*h + 2*a^2*e^2*h + b^2*(-(e^2*
f) + d*e*g + d^2*h)) + 2*c*e*(-2*b^2*d^2*g + 2*a^2*e*(-(e*g) + d*h) + a*b*(3*e^2*f + d*e*g + d^2*h)))*ArcTan[(
b + 2*c*x)/Sqrt[-b^2 + 4*a*c]])/((-b^2 + 4*a*c)^(3/2)*(c*d^2 + e*(-(b*d) + a*e))^2) + (e*(e^2*f - d*e*g + d^2*
h)*Log[d + e*x])/(c*d^2 + e*(-(b*d) + a*e))^2 - (e*(e^2*f - d*e*g + d^2*h)*Log[a + x*(b + c*x)])/(2*(c*d^2 + e
*(-(b*d) + a*e))^2)

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(808\) vs. \(2(401)=802\).
time = 0.19, size = 809, normalized size = 1.99

method result size
default \(\frac {e \left (d^{2} h -g d e +e^{2} f \right ) \ln \left (e x +d \right )}{\left (a \,e^{2}-d e b +c \,d^{2}\right )^{2}}-\frac {\frac {\frac {\left (a^{2} b \,e^{3} h +2 a^{2} c d \,e^{2} h -2 a^{2} c \,e^{3} g -2 a \,b^{2} d \,e^{2} h -a b c \,d^{2} e h +3 a b c d \,e^{2} g +a b c \,e^{3} f +2 a \,c^{2} d^{3} h -2 a \,c^{2} d^{2} e g -2 a \,c^{2} d \,e^{2} f +b^{3} d^{2} e h -b^{2} c \,d^{3} h -b^{2} c \,d^{2} e g -b^{2} c d \,e^{2} f +b \,c^{2} d^{3} g +3 b \,c^{2} d^{2} e f -2 c^{3} d^{3} f \right ) x}{4 a c -b^{2}}+\frac {2 a^{3} e^{3} h -3 a^{2} b d \,e^{2} h -a^{2} b \,e^{3} g +2 a^{2} c \,d^{2} e h +2 a^{2} c d \,e^{2} g -2 a^{2} c \,e^{3} f +a \,b^{2} d^{2} e h +a \,b^{2} d \,e^{2} g +a \,b^{2} e^{3} f -a b c \,d^{3} h -3 a b c \,d^{2} e g +a b c d \,e^{2} f +2 a \,c^{2} d^{3} g -2 a \,c^{2} d^{2} e f -b^{3} d \,e^{2} f +2 b^{2} c \,d^{2} e f -b \,c^{2} d^{3} f}{4 a c -b^{2}}}{c \,x^{2}+b x +a}+\frac {\frac {\left (4 a \,c^{2} d^{2} e h -4 a \,c^{2} d \,e^{2} g +4 a \,c^{2} e^{3} f -b^{2} c \,d^{2} e h +b^{2} c d \,e^{2} g -b^{2} c \,e^{3} f \right ) \ln \left (c \,x^{2}+b x +a \right )}{2 c}+\frac {2 \left (a^{2} b \,e^{3} h +2 a^{2} c d \,e^{2} h -2 a^{2} c \,e^{3} g -2 a \,b^{2} d \,e^{2} h +3 a b c \,d^{2} e h -a b c d \,e^{2} g +5 a b c \,e^{3} f -2 a \,c^{2} d^{3} h +2 a \,c^{2} d^{2} e g -6 a \,c^{2} d \,e^{2} f +b^{3} d \,e^{2} g -b^{3} e^{3} f -2 b^{2} c \,d^{2} e g +b \,c^{2} d^{3} g +3 b \,c^{2} d^{2} e f -2 c^{3} d^{3} f -\frac {\left (4 a \,c^{2} d^{2} e h -4 a \,c^{2} d \,e^{2} g +4 a \,c^{2} e^{3} f -b^{2} c \,d^{2} e h +b^{2} c d \,e^{2} g -b^{2} c \,e^{3} f \right ) b}{2 c}\right ) \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}}}{4 a c -b^{2}}}{\left (a \,e^{2}-d e b +c \,d^{2}\right )^{2}}\) \(809\)
risch \(\text {Expression too large to display}\) \(3801\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((h*x^2+g*x+f)/(e*x+d)/(c*x^2+b*x+a)^2,x,method=_RETURNVERBOSE)

[Out]

e*(d^2*h-d*e*g+e^2*f)*ln(e*x+d)/(a*e^2-b*d*e+c*d^2)^2-1/(a*e^2-b*d*e+c*d^2)^2*(((a^2*b*e^3*h+2*a^2*c*d*e^2*h-2
*a^2*c*e^3*g-2*a*b^2*d*e^2*h-a*b*c*d^2*e*h+3*a*b*c*d*e^2*g+a*b*c*e^3*f+2*a*c^2*d^3*h-2*a*c^2*d^2*e*g-2*a*c^2*d
*e^2*f+b^3*d^2*e*h-b^2*c*d^3*h-b^2*c*d^2*e*g-b^2*c*d*e^2*f+b*c^2*d^3*g+3*b*c^2*d^2*e*f-2*c^3*d^3*f)/(4*a*c-b^2
)*x+(2*a^3*e^3*h-3*a^2*b*d*e^2*h-a^2*b*e^3*g+2*a^2*c*d^2*e*h+2*a^2*c*d*e^2*g-2*a^2*c*e^3*f+a*b^2*d^2*e*h+a*b^2
*d*e^2*g+a*b^2*e^3*f-a*b*c*d^3*h-3*a*b*c*d^2*e*g+a*b*c*d*e^2*f+2*a*c^2*d^3*g-2*a*c^2*d^2*e*f-b^3*d*e^2*f+2*b^2
*c*d^2*e*f-b*c^2*d^3*f)/(4*a*c-b^2))/(c*x^2+b*x+a)+1/(4*a*c-b^2)*(1/2*(4*a*c^2*d^2*e*h-4*a*c^2*d*e^2*g+4*a*c^2
*e^3*f-b^2*c*d^2*e*h+b^2*c*d*e^2*g-b^2*c*e^3*f)/c*ln(c*x^2+b*x+a)+2*(a^2*b*e^3*h+2*a^2*c*d*e^2*h-2*a^2*c*e^3*g
-2*a*b^2*d*e^2*h+3*a*b*c*d^2*e*h-a*b*c*d*e^2*g+5*a*b*c*e^3*f-2*a*c^2*d^3*h+2*a*c^2*d^2*e*g-6*a*c^2*d*e^2*f+b^3
*d*e^2*g-b^3*e^3*f-2*b^2*c*d^2*e*g+b*c^2*d^3*g+3*b*c^2*d^2*e*f-2*c^3*d^3*f-1/2*(4*a*c^2*d^2*e*h-4*a*c^2*d*e^2*
g+4*a*c^2*e^3*f-b^2*c*d^2*e*h+b^2*c*d*e^2*g-b^2*c*e^3*f)*b/c)/(4*a*c-b^2)^(1/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(
1/2))))

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x^2+g*x+f)/(e*x+d)/(c*x^2+b*x+a)^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*a*c-b^2>0)', see `assume?` f
or more deta

________________________________________________________________________________________

Fricas [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x^2+g*x+f)/(e*x+d)/(c*x^2+b*x+a)^2,x, algorithm="fricas")

[Out]

Timed out

________________________________________________________________________________________

Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x**2+g*x+f)/(e*x+d)/(c*x**2+b*x+a)**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 860 vs. \(2 (415) = 830\).
time = 4.01, size = 860, normalized size = 2.11 \begin {gather*} -\frac {{\left (d^{2} h e - d g e^{2} + f e^{3}\right )} \log \left (c x^{2} + b x + a\right )}{2 \, {\left (c^{2} d^{4} - 2 \, b c d^{3} e + b^{2} d^{2} e^{2} + 2 \, a c d^{2} e^{2} - 2 \, a b d e^{3} + a^{2} e^{4}\right )}} + \frac {{\left (d^{2} h e^{2} - d g e^{3} + f e^{4}\right )} \log \left ({\left | x e + d \right |}\right )}{c^{2} d^{4} e - 2 \, b c d^{3} e^{2} + b^{2} d^{2} e^{3} + 2 \, a c d^{2} e^{3} - 2 \, a b d e^{4} + a^{2} e^{5}} - \frac {{\left (4 \, c^{3} d^{3} f - 2 \, b c^{2} d^{3} g + 4 \, a c^{2} d^{3} h - 6 \, b c^{2} d^{2} f e + 4 \, b^{2} c d^{2} g e - 4 \, a c^{2} d^{2} g e - b^{3} d^{2} h e - 2 \, a b c d^{2} h e + 12 \, a c^{2} d f e^{2} - b^{3} d g e^{2} - 2 \, a b c d g e^{2} + 4 \, a b^{2} d h e^{2} - 4 \, a^{2} c d h e^{2} + b^{3} f e^{3} - 6 \, a b c f e^{3} + 4 \, a^{2} c g e^{3} - 2 \, a^{2} b h e^{3}\right )} \arctan \left (\frac {2 \, c x + b}{\sqrt {-b^{2} + 4 \, a c}}\right )}{{\left (b^{2} c^{2} d^{4} - 4 \, a c^{3} d^{4} - 2 \, b^{3} c d^{3} e + 8 \, a b c^{2} d^{3} e + b^{4} d^{2} e^{2} - 2 \, a b^{2} c d^{2} e^{2} - 8 \, a^{2} c^{2} d^{2} e^{2} - 2 \, a b^{3} d e^{3} + 8 \, a^{2} b c d e^{3} + a^{2} b^{2} e^{4} - 4 \, a^{3} c e^{4}\right )} \sqrt {-b^{2} + 4 \, a c}} - \frac {b c^{2} d^{3} f - 2 \, a c^{2} d^{3} g + a b c d^{3} h - 2 \, b^{2} c d^{2} f e + 2 \, a c^{2} d^{2} f e + 3 \, a b c d^{2} g e - a b^{2} d^{2} h e - 2 \, a^{2} c d^{2} h e + b^{3} d f e^{2} - a b c d f e^{2} - a b^{2} d g e^{2} - 2 \, a^{2} c d g e^{2} + 3 \, a^{2} b d h e^{2} - a b^{2} f e^{3} + 2 \, a^{2} c f e^{3} + a^{2} b g e^{3} - 2 \, a^{3} h e^{3} + {\left (2 \, c^{3} d^{3} f - b c^{2} d^{3} g + b^{2} c d^{3} h - 2 \, a c^{2} d^{3} h - 3 \, b c^{2} d^{2} f e + b^{2} c d^{2} g e + 2 \, a c^{2} d^{2} g e - b^{3} d^{2} h e + a b c d^{2} h e + b^{2} c d f e^{2} + 2 \, a c^{2} d f e^{2} - 3 \, a b c d g e^{2} + 2 \, a b^{2} d h e^{2} - 2 \, a^{2} c d h e^{2} - a b c f e^{3} + 2 \, a^{2} c g e^{3} - a^{2} b h e^{3}\right )} x}{{\left (c d^{2} - b d e + a e^{2}\right )}^{2} {\left (c x^{2} + b x + a\right )} {\left (b^{2} - 4 \, a c\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x^2+g*x+f)/(e*x+d)/(c*x^2+b*x+a)^2,x, algorithm="giac")

[Out]

-1/2*(d^2*h*e - d*g*e^2 + f*e^3)*log(c*x^2 + b*x + a)/(c^2*d^4 - 2*b*c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a*c^2*d^2*g*e - b^3*d^2*h*e + a*b*c*d^2*h*e + b^2*c*d*f*e
^2 + 2*a*c^2*d*f*e^2 - 3*a*b*c*d*g*e^2 + 2*a*b^2*d*h*e^2 - 2*a^2*c*d*h*e^2 - a*b*c*f*e^3 + 2*a^2*c*g*e^3 - a^2
*b*h*e^3)*x)/((c*d^2 - b*d*e + a*e^2)^2*(c*x^2 + b*x + a)*(b^2 - 4*a*c))

________________________________________________________________________________________

Mupad [B]
time = 6.70, size = 2500, normalized size = 6.14 \begin {gather*} \text {Too large to display} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((f + g*x + h*x^2)/((d + e*x)*(a + b*x + c*x^2)^2),x)

[Out]

symsum(log(root(768*a^5*b*c^4*d^3*e^5*z^3 + 768*a^4*b*c^5*d^5*e^3*z^3 - 192*a^5*b^3*c^2*d*e^7*z^3 - 192*a^2*b^
3*c^5*d^7*e*z^3 - 68*a^3*b^6*c*d^2*e^6*z^3 - 68*a*b^6*c^3*d^6*e^2*z^3 + 36*a^2*b^7*c*d^3*e^5*z^3 + 36*a*b^7*c^
2*d^5*e^3*z^3 + 256*a^6*b*c^3*d*e^7*z^3 + 256*a^3*b*c^6*d^7*e*z^3 + 48*a^4*b^5*c*d*e^7*z^3 + 48*a*b^5*c^4*d^7*
e*z^3 - 480*a^4*b^2*c^4*d^4*e^4*z^3 + 440*a^3*b^4*c^3*d^4*e^4*z^3 - 320*a^4*b^3*c^3*d^3*e^5*z^3 - 320*a^3*b^3*
c^4*d^5*e^3*z^3 + 240*a^4*b^4*c^2*d^2*e^6*z^3 + 240*a^2*b^4*c^4*d^6*e^2*z^3 - 192*a^5*b^2*c^3*d^2*e^6*z^3 - 19
2*a^3*b^2*c^5*d^6*e^2*z^3 - 90*a^2*b^6*c^2*d^4*e^4*z^3 - 48*a^3*b^5*c^2*d^3*e^5*z^3 - 48*a^2*b^5*c^3*d^5*e^3*z
^3 - 4*b^9*c*d^5*e^3*z^3 - 4*b^7*c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^5*f + 20*a^3*b*c^3*e^6*f - a...

________________________________________________________________________________________